const path = require('path');
const { resolve } = path;  //path.resolve()方法用于将相对路径转为绝对路径

module.exports = {
  // config.resolve.alias : ChainedMap  config.resolve.alias  chainWebpack的官方文档中需要安装npm install --save-dev webpack-chain
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set("@api", resolve("src/api"))
  },
  devServer: {  
    host: 'dev.cekid.com',
    port: 8080,
    open:false,      
    hotOnly:true,   
    proxy: {
      '/api': {
        target: 'https://activityc.cekid.com',
        secure: false,
        changeOrigin: true,  
        pathRewrite: {
          '^/api': '/api/v1/brand/good/get'  
        }
      }
    },
    https:true
  }

}